# coding:utf-8
import argparse

import cv2


def compare(pathA, pathB, pathC):
    A = cv2.imread(pathA)
    B = cv2.imread(pathB)
    e = (A != B)
    if e.max() == 1:
        cv2.imwrite(pathC, A * e)


if __name__ == '__main__':
    parser = argparse.ArgumentParser()
    parser.add_argument('--A', help='src image A filepath')
    parser.add_argument('--B', help='src image B filepath')
    parser.add_argument('--C', help='dst image C filepath')
    args = parser.parse_args()

    compare(args.A, args.B, args.C)
